home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
CIncludes
/
ImageCodec.h
< prev
next >
Wrap
C/C++ Source or Header
|
1996-05-01
|
10KB
|
305 lines
/*
File: ImageCodec.h
Contains: QuickTime Interfaces.
Version: Technology: QuickTime 2.1
Release: Universal Interfaces 3.0d3 on Copland DR1
Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
Bugs?: If you find a problem with this file, send the file and version
information (from above) and the problem description to:
Internet: apple.bugs@applelink.apple.com
AppleLink: APPLE.BUGS
*/
#ifndef __IMAGECODEC__
#define __IMAGECODEC__
#ifndef __TYPES__
#include <Types.h>
#endif
#ifndef __QUICKDRAW__
#include <Quickdraw.h>
#endif
#ifndef __QDOFFSCREEN__
#include <QDOffscreen.h>
#endif
#ifndef __WINDOWS__
#include <Windows.h>
#endif
#ifndef __IMAGECOMPRESSION__
#include <ImageCompression.h>
#endif
#ifndef __COMPONENTS__
#include <Components.h>
#endif
#ifndef __MOVIES__
#include <Movies.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if PRAGMA_IMPORT_SUPPORTED
#pragma import on
#endif
#if PRAGMA_ALIGN_SUPPORTED
#pragma options align=mac68k
#endif
#if FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE
/* codec component selectors */
enum {
codecGetCodecInfo = 0x00,
codecGetCompressionTime = 0x01,
codecGetMaxCompressionSize = 0x02,
codecPreCompress = 0x03,
codecBandCompress = 0x04,
codecPreDecompress = 0x05,
codecBandDecompress = 0x06,
codecCDSequenceBusy = 0x07,
codecGetCompressedImageSize = 0x08,
codecGetSimilarity = 0x09,
codecTrimImage = 0x0A,
codecRequestSettings = 0x0B,
codecGetSettings = 0x0C,
codecSetSettings = 0x0D,
codecCDSequenceFlush = 0x0E,
codecSetTimeCode = 0x0F,
codecIsImageDescriptionEquivalent = 0x10,
codecNewMemory = 0x11,
codecDisposeMemory = 0x12,
codecHitTestData = 0x13
};
/* codec selectors 0-127 are reserved by Apple */
/* codec selectors 128-191 are subtype specific */
/* codec selectors 192-255 are vendor specific */
/* codec selectors 256-32767 are available for general use */
/* negative selectors are reserved by the Component Manager */
/* codec capabilities flags */
enum {
codecCanScale = 1L << 0,
codecCanMask = 1L << 1,
codecCanMatte = 1L << 2,
codecCanTransform = 1L << 3,
codecCanTransferMode = 1L << 4,
codecCanCopyPrev = 1L << 5,
codecCanSpool = 1L << 6,
codecCanClipVertical = 1L << 7,
codecCanClipRectangular = 1L << 8,
codecCanRemapColor = 1L << 9,
codecCanFastDither = 1L << 10,
codecCanSrcExtract = 1L << 11,
codecCanCopyPrevComp = 1L << 12,
codecCanAsync = 1L << 13,
codecCanMakeMask = 1L << 14,
codecCanShift = 1L << 15,
codecCanAsyncWhen = 1L << 16,
codecCanShieldCursor = 1L << 17,
codecCanManagePrevBuffer = 1L << 18,
codecHasVolatileBuffer = 1L << 19,
codecWantsRegionMask = 1L << 20
};
struct CodecCapabilities {
long flags;
short wantedPixelSize;
short extendWidth;
short extendHeight;
short bandMin;
short bandInc;
short pad;
unsigned long time;
};
typedef struct CodecCapabilities CodecCapabilities;
/* codec condition flags */
enum {
codecConditionFirstBand = 1L << 0,
codecConditionLastBand = 1L << 1,
codecConditionFirstFrame = 1L << 2,
codecConditionNewDepth = 1L << 3,
codecConditionNewTransform = 1L << 4,
codecConditionNewSrcRect = 1L << 5,
codecConditionNewMask = 1L << 6,
codecConditionNewMatte = 1L << 7,
codecConditionNewTransferMode = 1L << 8,
codecConditionNewClut = 1L << 9,
codecConditionNewAccuracy = 1L << 10,
codecConditionNewDestination = 1L << 11,
codecConditionFirstScreen = 1L << 12,
codecConditionDoCursor = 1L << 13,
codecConditionCatchUpDiff = 1L << 14,
codecConditionMaskMayBeChanged = 1L << 15,
codecConditionCodecChangedMask = 1L << 31
};
enum {
codecInfoResourceType = 'cdci', /* codec info resource type */
codecInterfaceVersion = 2 /* high word returned in component GetVersion */
};
struct CDSequenceDataSource {
long recordSize;
void * next;
ImageSequence seqID;
ImageSequenceDataSource sourceID;
OSType sourceType;
long sourceInputNumber;
void * dataPtr;
Handle dataDescription;
long changeSeed;
ProcPtr transferProc;
void * refCon;
};
typedef struct CDSequenceDataSource CDSequenceDataSource;
typedef CDSequenceDataSource *CDSequenceDataSourcePtr;
struct CodecCompressParams {
ImageSequence sequenceID; /* precompress,bandcompress */
ImageDescriptionHandle imageDescription; /* precompress,bandcompress */
Ptr data;
long bufferSize;
long frameNumber;
long startLine;
long stopLine;
long conditionFlags;
CodecFlags callerFlags;
CodecCapabilities * capabilities; /* precompress,bandcompress */
ICMProgressProcRecord progressProcRecord;
ICMCompletionProcRecord completionProcRecord;
ICMFlushProcRecord flushProcRecord;
PixMap srcPixMap; /* precompress,bandcompress */
PixMap prevPixMap;
CodecQ spatialQuality;
CodecQ temporalQuality;
Fixed similarity;
DataRateParamsPtr dataRateParams;
long reserved;
/* The following fields only exist for QuickTime 2.1 and greater */
UInt16 majorSourceChangeSeed;
UInt16 minorSourceChangeSeed;
CDSequenceDataSourcePtr sourceData;
};
typedef struct CodecCompressParams CodecCompressParams;
struct CodecDecompressParams {
ImageSequence sequenceID; /* predecompress,banddecompress */
ImageDescriptionHandle imageDescription; /* predecompress,banddecompress */
Ptr data;
long bufferSize;
long frameNumber;
long startLine;
long stopLine;
long conditionFlags;
CodecFlags callerFlags;
CodecCapabilities * capabilities; /* predecompress,banddecompress */
ICMProgressProcRecord progressProcRecord;
ICMCompletionProcRecord completionProcRecord;
ICMDataProcRecord dataProcRecord;
CGrafPtr port; /* predecompress,banddecompress */
PixMap dstPixMap; /* predecompress,banddecompress */
BitMapPtr maskBits;
PixMapPtr mattePixMap;
Rect srcRect; /* predecompress,banddecompress */
MatrixRecord * matrix; /* predecompress,banddecompress */
CodecQ accuracy; /* predecompress,banddecompress */
short transferMode; /* predecompress,banddecompress */
ICMFrameTimePtr frameTime; /* banddecompress */
long reserved[1];
/* The following fields only exist for QuickTime 2.0 and greater */
SInt8 matrixFlags; /* high bit set if 2x resize */
SInt8 matrixType;
Rect dstRect; /* only valid for simple transforms */
/* The following fields only exist for QuickTime 2.1 and greater */
UInt16 majorSourceChangeSeed;
UInt16 minorSourceChangeSeed;
CDSequenceDataSourcePtr sourceData;
RgnHandle maskRegion;
};
typedef struct CodecDecompressParams CodecDecompressParams;
enum {
matrixFlagScale2x = 1L << 7,
matrixFlagScale1x = 1L << 6,
matrixFlagScaleHalf = 1L << 5
};
extern pascal ComponentResult CDGetCodecInfo(Handle storage, CodecInfo *info);
extern pascal ComponentResult CDGetCompressionTime(Handle storage, PixMapHandle src, const Rect *srcRect, short depth, CodecQ *spatialQuality, CodecQ *temporalQuality, unsigned long *time);
extern pascal ComponentResult CDGetMaxCompressionSize(Handle storage, PixMapHandle src, const Rect *srcRect, short depth, CodecQ quality, long *size);
extern pascal ComponentResult CDPreCompress(Handle storage, CodecCompressParams *params);
extern pascal ComponentResult CDBandCompress(Handle storage, CodecCompressParams *params);
extern pascal ComponentResult CDPreDecompress(Handle storage, CodecDecompressParams *params);
extern pascal ComponentResult CDBandDecompress(Handle storage, CodecDecompressParams *params);
extern pascal ComponentResult CDCodecBusy(Handle storage, ImageSequence seq);
extern pascal ComponentResult CDGetCompressedImageSize(Handle storage, ImageDescriptionHandle desc, Ptr data, long bufferSize, ICMDataProcRecordPtr dataProc, long *dataSize);
extern pascal ComponentResult CDGetSimilarity(Handle storage, PixMapHandle src, const Rect *srcRect, ImageDescriptionHandle desc, Ptr data, Fixed *similarity);
extern pascal ComponentResult CDTrimImage(Handle storage, ImageDescriptionHandle Desc, Ptr inData, long inBufferSize, ICMDataProcRecordPtr dataProc, Ptr outData, long outBufferSize, ICMFlushProcRecordPtr flushProc, Rect *trimRect, ICMProgressProcRecordPtr progressProc);
#endif
#if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
extern pascal ComponentResult CDRequestSettings(Handle storage, Handle settings, Rect *rp, ModalFilterUPP filterProc);
#endif
#if FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE
extern pascal ComponentResult CDGetSettings(Handle storage, Handle settings);
extern pascal ComponentResult CDSetSettings(Handle storage, Handle settings);
extern pascal ComponentResult CDCodecFlush(Handle storage);
extern pascal ComponentResult CDCodecSetTimeCode(Handle storage, void *timeCodeFormat, void *timeCodeTime);
extern pascal ComponentResult CDCodecIsImageDescriptionEquivalent(Handle storage, ImageDescriptionHandle newDesc, Boolean *equivalent);
extern pascal ComponentResult CDCodecNewMemory(Handle storage, Ptr *data, Size dataSize, long dataUse, ICMMemoryDisposedUPP memoryGoneProc, void *refCon);
extern pascal ComponentResult CDCodecDisposeMemory(Handle storage, Ptr data);
extern pascal ComponentResult CDCodecHitTestData(Handle storage, ImageDescriptionHandle desc, void *data, Size dataSize, Point where, Boolean *hit);
#endif
#if PRAGMA_ALIGN_SUPPORTED
#pragma options align=reset
#endif
#if PRAGMA_IMPORT_SUPPORTED
#pragma import off
#endif
#ifdef __cplusplus
}
#endif
#endif /* __IMAGECODEC__ */